package ai

import (
	"chatgpt/helper"
	"chatgpt/plugin/dirtywords"
)

var AppAiEneity AppAI

type AppAI struct {
}

func (self *AppAI) CheckQuestion(question string) bool {
	if len([]rune(question)) < 3 {
		return true
	}
	if !dirtywords.DirtyWords().Contains(question) {
		return true
	}
	return false
}

func (self *AppAI) Unsafe(questioin, model string) bool {
	if model == helper.UNSAFE_MOD {
		return true
	}
	if len(questioin) <= 2 {
		return true
	}
	if questioin[:2] == "@@" {
		return true
	}
	return false
}
